<template>
<div class="cards-list">
  <a :href="item.content.source_link" target="_blank" class="cards-img">
    <img :src="item.content.cover" alt="图片加载失败">
  </a>
  <a :href="item.content.source_link" target="_blank" class="cards-msg">{{item.content.title}}</a>
  <div class="cards-ft">
    <span class="cards-time">{{item.content.date | time}}</span>
    <span class="vertical-bar" v-if="item.content.source"></span>
    <span class="cards-source" v-if="item.content.source">{{item.content.source}}</span>
  </div>
</div>
</template>

<script>
  export default {
    name: 'search-report',
    props: ['item']
  }
</script>

<style lang="scss">
  .cards-list {
    cursor: pointer;
    margin-right: 10px;
    width: 314px;
    height: 220px;
    position: relative;
    margin-bottom: 16px;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.14);
    box-shadow: 1px 1px 2px 0 rgba(0, 0, 0, 0.14);
    &:hover {
      border-color: #00ba91;
    }
    .cards-img {
      display: block;
      width: 100%;
      height: 140px;
      overflow: hidden;
      &:hover img {
        transform: scale(1.05);
      }
      img {
        text-align: center;
        font-size: 16px;
        line-height: 140px;
        color: #00ba91;
        width: 100%;
        height: 100%;
        transition: all .7s;
      }
    }
    .cards-msg {
      width: 93%;
      margin: 10px auto;
      display: -webkit-box;
      -webkit-box-orient: vertical;
      -webkit-line-clamp: 2;
      overflow: hidden;
      &:hover {
        color: #00ba91;
      }
    }
    .cards-ft {
      position: absolute;
      bottom: 5px;
      display: flex;
      align-items: center;
      .cards-time{
        font-size: 12px;
        padding-left: 10px;
        color: #aaaaaa;
      }
      .cards-source {
        font-size: 12px;
        color: #aaaaaa;
      }
      .vertical-bar {
        width: 1px;
        height: 13px;
        background: #aaaaaa;
        margin: 0 10px;
      }
    }
  }
</style>
